package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcRoleRight;
import com.visizen.wisdomclass.server.model.WcRoleRightExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcRoleRightMapper {
    @SelectProvider(type=WcRoleRightSqlProvider.class, method="countByExample")
    int countByExample(WcRoleRightExample example);

    @DeleteProvider(type=WcRoleRightSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcRoleRightExample example);

    @Delete({
        "delete from wc_role_right",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_role_right (ID, ROLE_ID, ",
        "RIGHT_ID, RIGHT_TYPE)",
        "values (#{ID,jdbcType=BIGINT}, #{ROLE_ID,jdbcType=BIGINT}, ",
        "#{RIGHT_ID,jdbcType=BIGINT}, #{RIGHT_TYPE,jdbcType=INTEGER})"
    })
    int insert(WcRoleRight record);

    @InsertProvider(type=WcRoleRightSqlProvider.class, method="insertSelective")
    int insertSelective(WcRoleRight record);

    @SelectProvider(type=WcRoleRightSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="ROLE_ID", property="ROLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RIGHT_ID", property="RIGHT_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RIGHT_TYPE", property="RIGHT_TYPE", jdbcType=JdbcType.INTEGER)
    })
    List<WcRoleRight> selectByExample(WcRoleRightExample example);

    @Select({
        "select",
        "ID, ROLE_ID, RIGHT_ID, RIGHT_TYPE",
        "from wc_role_right",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="ROLE_ID", property="ROLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RIGHT_ID", property="RIGHT_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="RIGHT_TYPE", property="RIGHT_TYPE", jdbcType=JdbcType.INTEGER)
    })
    WcRoleRight selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcRoleRightSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcRoleRight record, @Param("example") WcRoleRightExample example);

    @UpdateProvider(type=WcRoleRightSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcRoleRight record, @Param("example") WcRoleRightExample example);

    @UpdateProvider(type=WcRoleRightSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcRoleRight record);

    @Update({
        "update wc_role_right",
        "set ROLE_ID = #{ROLE_ID,jdbcType=BIGINT},",
          "RIGHT_ID = #{RIGHT_ID,jdbcType=BIGINT},",
          "RIGHT_TYPE = #{RIGHT_TYPE,jdbcType=INTEGER}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcRoleRight record);
}